#pragma once
#include "../stdafx.h"
//#include "./Figure.h"
//#include "../scene/World.h"
#include "../LogicEngine.h"
#include "WoWLoader.h"
//#include "../render/ScreenWorld.h"
#include "../../externel/tinyxml/tinyxml.h"


	class World;
	class WoWLoader;

    class ModelLoaderMid : public Component
    {
    public:
        ModelLoaderMid(void);
        ~ModelLoaderMid(void);

        void addedToObject();

        void PolyModel(Message const& msg);
    };

	class Resource : public Component
	{
	public:
		Resource(void);
		~Resource(void);

		void addedToObject();

		void Init(Message const& msg); //Initialize all the resource, include texture, sound, script.

		bool LoadRes();
		void LoadFightRes(Message const& msg);
		void LoadFigure(Message const& msg);
		void LoadSysMenu(Message const& msg);
		void LoadFightMenu(Message const& msg);
		void LoadMap(Message const & msg);
        void LoadModel();
        void LoadFigureInfo();
		D3DXVECTOR2 LoadFightMap();
		GAME_STATE LoadSceneState();
		void NextScene(Message const& msg);

	private:
		TiXmlDocument m_rmdoc;
		TiXmlHandle m_prmRoot;
		TiXmlElement* m_curNode;

		TiXmlDocument m_scrdoc;
		TiXmlHandle m_pscrRoot;

		//bool LoadScript(const char*);
		//BOOL LoadTexture(TiXmlElement*);
		//BOOL LoadSound(TiXmlElement*);
		
		/*TiXmlDocument m_scrdoc;
		
		TiXmlHandle m_pscrRoot;
		TiXmlElement* m_pscrNode;
		TiXmlElement* m_ptexNode;*/

	};